import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.AccountCircle
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import kotlinx.coroutines.launch

@Composable
@Preview
fun App() {
    MaterialTheme {
        Scaffold(topBar = {
            TopAppBar(
                title = {
                    Text(
                        text = "Compose controls gallery",
                        textAlign = TextAlign.Center,
                        modifier = Modifier.fillMaxWidth()
                    )
                },
                navigationIcon = { Icon(Icons.Default.AccountCircle, null) })

        }) {
            Surface(color = MaterialTheme.colors.background, modifier = Modifier.fillMaxSize()) {
                Row {
                    Column(modifier = Modifier.fillMaxHeight()) {
                        Row { Text("列表") }
                        Row(verticalAlignment = Alignment.Bottom) { Text("主题切换") }
                        Row(verticalAlignment = Alignment.Bottom) { Text("主题色切换") }
                    }
                    Spacer(Modifier.padding(horizontal = 5.dp))
                    Column(modifier = Modifier.fillMaxHeight(), verticalArrangement = Arrangement.Center) {
                        Text("内容")
                    }
                }
            }
        }


    }
}

fun main() = application {
    Window(onCloseRequest = ::exitApplication, title = "Compose controls gallery") {
        App()
    }
}
